package cn.redsoft.turingapi.request;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import cn.redsoft.turingapi.exception.TuringRequestException;
import cn.redsoft.turingapi.msg.BaseMsg;

/**
 * 图灵 API 请求
 * 
 * @author HuYongLiang
 *
 */
public abstract class TuringRequest {

	protected TuringRequestMetaData metaData;

	protected Logger log = LoggerFactory.getLogger(this.getClass());

	@Deprecated
	public TuringRequest() {
	}

	public TuringRequest(TuringRequestMetaData metaData) {
		super();
		this.metaData = metaData;
	}

	public abstract BaseMsg getResult() throws TuringRequestException;

	public String getKey() {
		return metaData.getKey();
	}

	public void setKey(String key) {
		metaData.setKey(key);
	}

	public String getInfo() {
		return metaData.getInfo();
	}

	public void setInfo(String info) {
		metaData.setInfo(info);
	}

	public String getUserid() {
		return metaData.getUserid();
	}

	public void setUserid(String userid) {
		metaData.setUserid(userid);
	}

	public String getLoc() {
		return metaData.getLoc();
	}

	public void setLoc(String loc) {
		metaData.setLoc(loc);
	}

	public long getLon() {
		return metaData.getLon();
	}

	public void setLon(long lon) {
		metaData.setLon(lon);
	}

	public long getLat() {
		return metaData.getLat();
	}

	public void setLat(long lat) {
		metaData.setLat(lat);
	}

	@Override
	public String toString() {
		return "TuringRequest [metaData=" + metaData + "]";
	}

}
